<script lang="ts" setup>
import CisJsonViewer from '@/lib/CisJsonViewer/CisJsonViewer.js'
import '@/lib/CisJsonViewer/style.css'

const obj = {
  name: "qiu",//字符串
  age: {
    name: {
      key: '666'
    }
  },//数组
  isMan: false,//布尔值
  date: new Date(),
  fn: () => {
  },
  arr: [1, 2, 5]
};
const jsonData = ref(obj as any);
const onKeyClick = (rs: any, keyName: any) => {
  console.log(rs);
  console.log(keyName);
}

const keyChange = () => {
  jsonData.value = {key: '111'};
}
</script>
<template>
  <div class="w-800px h-500px">
    <CisJsonViewer :data="jsonData" @onKeyClick="onKeyClick"></CisJsonViewer>
  </div>
  <el-button @click="keyChange">属性变更</el-button>
</template>

